package com.future.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.future.consumer.service.ConsumerService;

@RestController
public class ConsumerController {

	@RequestMapping("/hello-consumer")
	public String helloConsumer() {
		// 调用hello-service服务，注意这里用的是服务名，而不是具体的ip+port
		try {
			return service.consumer();
		} catch (Exception e) {
			System.out.println(e.toString());
			return "";
		}
	}

	@Autowired
	// RestTemplate restTemplate;
	private ConsumerService service;
}
